package Cars.Models;

public abstract class BaseModel {
    protected String type; //车的类型
    protected Float Price; //单价
    private String No; //车牌号
    private String Brand; //品牌
    private String Color;//颜色
    private Double Mileages;//里程数
    private Short CarWords;//座位数目

    public String getType() {
        return type;
    }

    public void setType(int type) throws Exception {

    }

    public Short getCarWords() {
        return CarWords;
    }

    protected void setCarWords(Short carWords) {
        CarWords = carWords;
    }

    public void setPrice(Float price) {
        Price = price;
    }

    public Float getPrice() {
        return Price;
    }

    public String getNo() {
        return No;
    }

    public void setNo(String no) {
        No = no;
    }

    public String getBrand() {
        return Brand;
    }

    public void setBrand(String brand) {
        Brand = brand;
    }

    public String getColor() {
        return Color;
    }

    public void setColor(String color) {
        Color = color;
    }

    public Double getMileages() {
        return Mileages;
    }

    public void setMileages(Double mileages) {
        Mileages = mileages;
    }

    /**
     * @return 返回需要付的钱数
     */
    public double CalcRent(short intValue) {
        return (double) (getPrice() * intValue);
    }


    @Override
    public String toString() {
        return "BaseModel{" +
                "type='" + type + '\'' +
                ", Price=" + Price +
                ", No='" + No + '\'' +
                ", Brand='" + Brand + '\'' +
                ", Color='" + Color + '\'' +
                ", Mileages=" + Mileages +
                ", CarWords=" + CarWords +
                '}';
    }
}
